package com.itlong.cloud.project.operate;

import com.itlong.cloud.POJO.DTO.operate.DeadQueueGetPageDTO;
import com.itlong.cloud.POJO.PO.TimeTaskDeadMessageQueuePO;
import com.itlong.cloud.utils.page.Page;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * <desc>
 *      死信队列业务逻辑处理暴露接口。
 * </desc>
 *
 * @createDate 2017/11/29
 */
@FeignClient(name = "common-service")
public interface ITimeTaskDeadMessageQueueServiceClient {
    /**
     * <desc>
     *      获取分页数据
     * </desc>
     *
     * @param pageDTO 查询参数DTO
     * @return page模型
     * @author Jiaqi.X
     * @createDate 2017/09/25
     */
    @RequestMapping(path = "/operate/system/deadQueue/getPage")
    Page<TimeTaskDeadMessageQueuePO> getPage(@RequestBody DeadQueueGetPageDTO pageDTO) throws Exception;

    /**
     * <desc>
     *      发送死信
     * </desc>
     *
     * @param po
     * @author Jiaqi.X
     * @createDate 2017/11/29
     */
    @RequestMapping(path = "/operate/system/deadQueue/sendMessage")
    void sendMessage(@RequestBody TimeTaskDeadMessageQueuePO po) throws Exception;

    /**
     * <desc>
     *     定时任务检测错误的死信消息进行重发
     * </desc>
     *
     * @author Jiaqi.X
     * @createDate 2018/01/27
     */
    @RequestMapping(path = "/operate/system/deadQueue/autoRedirectSendDeadMessage")
    void autoRedirectSendDeadMessage() throws Exception;
}
